Skip to content

perf: update alien signals to v0.5 & fixed performance regression since v2.1#122

Merged
medz merged 2 commits into
mainfrom
deps/alien_signals-0.5
Jul 31, 2025
Merged

perf: update alien signals to v0.5 & fixed performance regression since v2.1#122
medz merged 2 commits into
mainfrom
deps/alien_signals-0.5

Conversation

@medz

@medz medz commented Jul 31, 2025

Copy link
Copy Markdown
Collaborator

fixes #120

  • replace magic numbers with documented reactive flags
  • refactor effect queue to use linked list instead of map

medz added 2 commits July 31, 2025 23:15
- Replace map-based effect queue with linked list implementation
- Simplify queue management with head and tail pointers
- Remove unused pauseStack field
@codecov

codecov Bot commented Jul 31, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (cede0e8) to head (09d3fcb).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #122   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines          927       930    +3     
=========================================
+ Hits           927       930    +3     
Files with missing lines Coverage Δ
packages/solidart/lib/src/core/alien.dart 100.00% <100.00%> (ø)
...ackages/solidart/lib/src/core/reactive_system.dart 100.00% <100.00%> (ø)
packages/solidart/lib/src/core/read_signal.dart 100.00% <100.00%> (ø)

@nank1ro nank1ro left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, that was fast. I hadn't noticed that you were already at v0.5 😅

Jist one question: why haven't used constants like WATCHING = 2 instead of placing the numbers here and documenting them every time?

@medz medz changed the title Update alien signals to v0.5 & fixed performance regression perf: update alien signals to v0.5 & fixed performance regression since v2.1 Jul 31, 2025
@medz

medz commented Jul 31, 2025

Copy link
Copy Markdown
Collaborator Author

Wow, that was fast. I hadn't noticed that you were already at v0.5 😅

Jist one question: why haven't used constants like WATCHING = 2 instead of placing the numbers here and documenting them every time?

By setting a specific int value, the memory address lookup during runtime and the bit operations are reduced.

@medz

medz commented Jul 31, 2025

Copy link
Copy Markdown
Collaborator Author

Of course, this isn't mandatory; you can define ReactiveFlags constants in Solidart to represent these values.

In my opinion, there's no difference between defining constants and specifying specific values and adding annotations.

@nank1ro

nank1ro commented Jul 31, 2025

Copy link
Copy Markdown
Owner

I really thought it was for performance reasons, although I also thought that saving them as constants was a good practice anyway, also to make the code more readable.

BTW feel free to merge it yourself

@medz medz merged commit 23942bc into main Jul 31, 2025
3 checks passed
@medz medz deleted the deps/alien_signals-0.5 branch July 31, 2025 15:44
@medz

medz commented Jul 31, 2025

Copy link
Copy Markdown
Collaborator Author

It has no impact on external APIs, it's just an internal optimization of Solidart, so my suggestion is to just release a fix version.

E.g: 2.1.1

@nank1ro

nank1ro commented Jul 31, 2025

Copy link
Copy Markdown
Owner

@all-contributors please add @medz for code, bug, doc

@allcontributors

Copy link
Copy Markdown
Contributor

@nank1ro

I've put up a pull request to add @medz! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: Upgrade dep alien_signals to v5 version

2 participants